package com.wj.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wj.dao.MenuMapper;
import com.wj.pojo.Menu;
import com.wj.service.IMenuService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wj
 * @since 2022-03-06
 */
@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IMenuService {
    @Resource
    MenuMapper menuMapper;

    /**
     * 通过id获得菜单列表
     * @param id
     * @return
     */
    @Override
    public List<Menu> getMenusByAdminId(Integer id) {
        return menuMapper.getMenusByAdminId(id);
    }

    /**
     * 根据角色获取菜单列表
     * @return
     */
    @Override
    public List<Menu> getAllMenuWithRole() {
        return menuMapper.getAllMenuWithRole();
    }

    /**
     * 获取所有菜单
     * @return
     */
    @Override
    public List<Menu> getAllMenu() {
        return menuMapper.getAllMenu();
    }
}
